<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ng-value</title>
    <script src="./lib/angular.min.js"></script>
</head>
<body ng-app="wu">
<div ng-controller="ctrl">
    <p>
        商品：
        <input type="text" ng-model="goods.title">
    </p>
    <p>
        价格：
        <input type="text" ng-model="goods.price">
    </p>
    <p>
        数量:
        <input type="text" ng-model="goods.num">
    </p>
    <p>
        总价：
        <input type="text" readonly ng-value="goods.price*goods.num">
    </p>
</div>

<script>
    var m = angular.module('wu',[]);
    m.controller('ctrl',['$scope',function (scope) {
        scope.goods = {
            'title':'PHP编程',
            'price':90,
            'num':2
        };
    }]);
</script>
</body>
</html>